#pragma once
namespace html { namespace dom
{
  inline bool criteria::operator==(const node& _node) const {
    // universal selector is when all items are invalid
    // type selector
    if (tag_ != symbol::nil() && tag_ != _node.tag())
      return false;
    // ID selector
    if (id_ != symbol::nil() && id_ != _node.id())
      return false;
    // class selector
    for (set<symbol>::const_iterator it=classes_.begin(); it!=classes_.end(); it++ )
      if (_node.classes().find(*it) == _node.classes().end())
        return false;
    return true;
  }
} }
